package com.study.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
public class MyGoodDay {
    public static List<String> list=new ArrayList<String>();

    @RequestMapping("index")
    public String index(String name,ModelMap map) {
//        map.addAttribute("message", "哦！原来是我的小仙女来了啊！");
        map.addAttribute("name", name);
        map.addAttribute("users", getUserList());
        return "index";
    }

    private List<String> getUserList(){
        list.add("张三");
        list.add("李四");
        list.add("王二");
        return list;
    }

}
